# 测试代码
import random
def generate_test_array(length, min_val, max_val):
    return [random.randint(min_val, max_val) for _ in range(length)]